import request from '@/utils/request'

// 1 写 axios
export function reqGetDepartments() {
  return request({
    method: 'get',
    url: '/company/department'
  })
}
// 2按需导出
export function reqDelDepartment(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`

  })
}
// 3提交表单 添加 子部门
export function reqAddDEpartment(data) {
  return request({
    menthod: 'post',
    url: '/company/deparment',
    data
  })
}
// 4.编辑  获取当前部门 的信息
export function reqGetDepartDetail(id) {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}
// 5.更新 部门
export function reqUpdateDepartment(form) {
  return request({
    method: 'put',
    url: `/company/department/${form.id}`,
    data: form
  })
}
